# --------------------------------------------------------
#  Copyright (C) 2004-2019 by EMGU Corporation. All rights reserved.
# --------------------------------------------------------

IF((EMGU_CV_BUILD OR EMGU_CV_EXAMPLE_BUILD) AND EMGU_CV_WITH_TESSERACT)

PROJECT(Emgu.CV.OCR)

#IF (NOT ANDROID)
#FILE(GLOB_RECURSE SRC_CV_OCR RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.cs")
#LIST(APPEND SRC_CV_OCR ${CMAKE_CURRENT_SOURCE_DIR}/../CommonAssemblyInfo.cs)
#GENERATE_DOCUMENT(${LIBRARY_OUTPUT_PATH}/${PROJECT_NAME})
#SIGN_ASSEMBLY(${CMAKE_CURRENT_SOURCE_DIR}/../Emgu.CV.snk)
#SET_CS_TARGET_FRAMEWORK(${CSC_TARGET_FRAMEWORK})
#ADD_CS_REFERENCES("${LIBRARY_OUTPUT_PATH}/Emgu.Util.dll;${LIBRARY_OUTPUT_PATH}/Emgu.CV.dll")

#FILE(GLOB TESSDATA "${CMAKE_CURRENT_SOURCE_DIR}/tessdata/eng.*")
#FOREACH(TESSDATA_FILE ${TESSDATA})
#  GET_FILENAME_COMPONENT(TESSDATA_FILE_NAME ${TESSDATA_FILE} NAME)
#  ADD_CS_FILE_TO_DEPLOY(${TESSDATA_FILE} tessdata/${TESSDATA_FILE_NAME})
#ENDFOREACH()
#COMPILE_CS(${PROJECT_NAME} "library" "${SRC_CV_OCR}" ALL)
#INSTALL(
#FILES 
#${LIBRARY_OUTPUT_PATH}/${PROJECT_NAME}.dll 
#${LIBRARY_OUTPUT_PATH}/${PROJECT_NAME}.xml
#DESTINATION ${CPACK_PACKAGE_CLI_FOLDER}
#COMPONENT emgucv_binary)
#if(ENABLE_SOLUTION_FOLDERS)
#    set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER "emgu")
#endif()

#ADD_DEPENDENCIES(${PROJECT_NAME} Emgu.CV Emgu.Util)

#ENDIF()

#INSTALL(FILES 
#${TESSDATA}
#DESTINATION bin/tessdata COMPONENT emgucv_binary)

IF(WIN32 OR APPLE OR ANDROID)
#IF(NETFX_CORE OR ANDROID)
INSTALL(
  DIRECTORY
  ${CMAKE_CURRENT_SOURCE_DIR}
  DESTINATION .
    COMPONENT emgucv_source
  FILES_MATCHING 
  PATTERN "*.cs"
  PATTERN "*.shproj"
  PATTERN "*.projitems"
  PATTERN "*.resx"
  #PATTERN "tessdata/eng.*"
  PATTERN ".svn" EXCLUDE
  PATTERN "obj" EXCLUDE
  PATTERN "CMakeFiles" EXCLUDE
  PATTERN "${PROJECT_NAME}.dir" EXCLUDE
)
#ELSE()
#INSTALL(
#  DIRECTORY
#  ${CMAKE_CURRENT_SOURCE_DIR}
#  DESTINATION .
#    COMPONENT emgucv_source
#  FILES_MATCHING 
#  PATTERN "*.cs"
#  PATTERN "*.csproj"
#  PATTERN "*.resx"
#  PATTERN "tessdata/eng.*"
#  PATTERN ".svn" EXCLUDE
#  PATTERN "obj" EXCLUDE
#  PATTERN "CMakeFiles" EXCLUDE
#  PATTERN "${PROJECT_NAME}.dir" EXCLUDE
#  PATTERN "*Android*" EXCLUDE
#  PATTERN "*iOS*" EXCLUDE
#)
#ENDIF()

ENDIF()

ENDIF()
